/*
 * @Author: your name
 * @Date: 2022-02-03 20:12:15
 * @LastEditTime: 2022-02-10 23:35:07
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \ts\01.静态类型.ts
 */
console.log('静态类型demo')
const count: number = 123
const s: string = '456'
const obj:  object = {}
// obj.a = 1 没有a，报错

function fun () : string {
return '2332'
}

// 对象

let obj1 :{name:string, age:number} = {
    name:'12',age:12
}

// 数组1
let arr:string[] = ['23','232']
let arr1:number[] = [1,2]
let a3 : object[] =[{1:1}]

// 接口模式
interface people {
    name:string,
    age: number
}

let p1 : people = {
    name:'可乐',
    age:123
}


// 对象数组
let arr2:people[] =[{name:'12',age:2}]

// 类
class Person {
     name1="12"
}
let pe:Person = new Person()


console.log(count, fun(), p1, pe.name1)
